Skip to content

Sheffield | 26-Java-June | Hassan Osman | Sprint 4 | Prep: Data Structures - #65

Open
HassanOHOsman wants to merge 30 commits into
CodeYourFuture:mainfrom
HassanOHOsman:prep/data-structures-exercises
Open

HassanOHOsman wants to merge 30 commits into
CodeYourFuture:mainfrom
HassanOHOsman:prep/data-structures-exercises

Conversation

@HassanOHOsman

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

In this PR, I answered all 4 exercises associated with the Data Structures segement from the Prep section.

…ctor that takes those arrays as parameters.

Add getters to allow accessing those fields.
… ONLY unique first names of students, in alphabetical order.
…so that duplicate elements are excluded.

2. Create a main method inside a Main class, and start calling methods to print into console
…rough lastname array and place each lastname with it's corresponding lastname as key-value pairs in the HashMap structure.

2. Add and resue the rest of the methods from StudentGrades class in the main method to print out their output
…trings).

2. Reflect this change on the constructor and getters.
2. Add the array sets into the main method and update the data to include twins.
…ise 2.1.

2. Remove module - exercise 2.2 for the above reason.
2. Modify the collections to remove that student.
@HassanOHOsman HassanOHOsman added 📅 Sprint 4 Assigned during Sprint 4 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 3, 2026
@HassanOHOsman HassanOHOsman closed this by deleting the head repository Aug 8, 2026
Comment thread .idea/compiler.xml Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shouldnt be included

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorted. Thank you.

public Set<String> getDistinctFirstNamesInAlphabeticalOrder(String[] firstNames) {
Set<String> set = new TreeSet<>();
set.addAll(Arrays.asList(firstNames));
return set;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this in order?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 4 Assigned during Sprint 4 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants